package models

import (
	types "com.yy.api/common/pojo/models"
	"gorm.io/gorm"
)

type ContainerBasic struct {
	gorm.Model
	ContainerId  string              `gorm:"size:255;comment:容器ID"`
	PortMappings []types.PortMapping `gorm:"serializer:json;comment:端口映射信息"`
	UserId       string              `gorm:"size:255;comment:用户ID"`
}

func (table *ContainerBasic) TableName() string {
	return "container_basic"
}

func NewContainerBasic(containerId string, portMappings []types.PortMapping, userId string) *ContainerBasic {
	return &ContainerBasic{
		ContainerId:  containerId,
		PortMappings: portMappings,
		UserId:       userId,
	}
}
